package pl.edu.agh.inpema.core.model;

public class AnalyzeResult implements Comparable<AnalyzeResult> {

	private int profileId;
	private String profileValue;
	private String analyzerName;
	private String receiverName;
	private int analyzeResultDataId;
	
	public int getProfileId() {
		return profileId;
	}
	public void setProfileId(int profileId) {
		this.profileId = profileId;
	}
	public String getProfileValue() {
		return profileValue;
	}
	public void setProfileValue(String profileValue) {
		this.profileValue = profileValue;
	}
	public String getAnalyzerName() {
		return analyzerName;
	}
	public void setAnalyzerName(String analyzerName) {
		this.analyzerName = analyzerName;
	}
	public String getReceiverName() {
		return receiverName;
	}
	public void setReceiverName(String receiverName) {
		this.receiverName = receiverName;
	}
	public int getAnalyzeResultDataId() {
		return analyzeResultDataId;
	}
	public void setAnalyzeResultDataId(int analyzeResultDataId) {
		this.analyzeResultDataId = analyzeResultDataId;
	}
	
	public int compareTo(AnalyzeResult r) {
		//int reciversComparation = this.receiverName.compareTo(p.getReceiverName());
		//if (reciversComparation == 0)
			return this.profileValue.compareTo(r.getProfileValue());
		//else
		//	return reciversComparation;
	}
	
	public boolean equals(Object o) {
		AnalyzeResult r = (AnalyzeResult) o;
		//if (this.profileId != r.getProfileId())
		//	return false;
		if (! this.profileValue.equals(r.getProfileValue()))
			return false;
		//if (! this.analyzerName.equals(r.getAnalyzerName()))
		//	return false;
		//if (! this.receiverName.equals(r.getReceiverName()))
		//	return false;
		//if (this.analyzeResultDataId != r.getAnalyzeResultDataId())
		//	return false;
		return true;
	}
	
	public int hashCode() {
		return new Integer(this.analyzeResultDataId).hashCode();
	}
	
	public String toString() {
		//return this.receiverName + ":" + this.value;
		return this.profileValue;
	}
}
